package com.zhijian.medical.holder;

import com.zhijian.medical.entity.dto.PersonDto;
import org.springframework.stereotype.Component;

/**
 * @author lixiaodong
 */
public class CurrentUserHolder {
    private static ThreadLocal<PersonDto> users = new ThreadLocal<>();

    public static PersonDto getUser() {
        return users.get();
    }

    public static void setUser(PersonDto personDto) {
        users.set(personDto);
    }

    public static void clear() {
        users.remove();
    }
}
